#include <iostream>
#include <string>

using namespace std;


class Solution
{
public:
	string countAndSay(int n) {
		if(n==0)
			return "";
		if(n==1)
			return "1";

		string pre=countAndSay(n-1);

		char chr=pre[0];
		int cnt=1;
		string result="";

		for(int i=1;i<pre.length();++i)
		{
			if(chr!=pre[i]){
				result+=(cnt+'0');
				result+=chr;
				chr=pre[i];
				cnt=1;
			}
			else{
				cnt++;
			}
		}

		result+=cnt+'0';
		result+=chr;

		return result;
	}
};

int main()
{
	Solution solution;
	int n;
	while(cin>>n){
		cout<<solution.countAndSay(n)<<endl;
	}
}